import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve:{
    alias:{
      '/@/': path.resolve(__dirname,'./src')
    }
  },
  server:{
    host:'', // 主机
    port: 3000, // 端口
    https: true, // 是否开启 https
    open: false, // 是否在浏览器自动打开
    proxy: {
      '/api': {
        target: 'http://jsonplaceholder.typicode.com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
    }
  }
})
